import Vue from 'vue'
import Vuex from 'vuex'
// import base from './modules/base'
// import hotel from './modules/hotel'
Vue.use(Vuex)

const SET_HOTEL = "SET_HOTEL"; 
const state = {
  isLoading: false,
  direction: 'forward',
  hotel: "wocao"
}
const mutations = {
  UPDATE_LOADING (state, status) {
    state.isLoading = status
  },
  UPDATE_DIRECTION (state, direction) {
    state.direction = direction
  },
  UPDATE_HOTEL (state, hotel) {
    state.hotel = hotel
  }
}
const actions = {
  [SET_HOTEL]({commit},{hotel}){  
        commit('SET_HOTEL', hotel);  
    }
}
const getters = {  
    getHotel: state => {  
        return state.hotel;  
    }
}  
export default new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})
// export default new Vuex.Store({
//   modules: {
//     base,
//     hotel
//   },
//   strict: false
// })